About DRML

Hi folks,

Is there anyone familiar with it? Is it a part of DOORS?

I need someone help. If you have any clue, please let me know.

Thank you.

Edward
Edward_Wang - Thu Mar 24 08:14:24 EDT 2011

Re: About DRML
SystemAdmin - Fri Mar 25 04:05:40 EDT 2011

We need more info - are you referring to DRML digital content types files or something else?

If it's DRML digital content types files you're referring to then what are you wanting to do with them?
Paul Miller
Melbourne, Australia

Re: About DRML
Edward_Wang - Wed Jun 22 04:45:42 EDT 2011

SystemAdmin - Fri Mar 25 04:05:40 EDT 2011
We need more info - are you referring to DRML digital content types files or something else?

If it's DRML digital content types files you're referring to then what are you wanting to do with them?


Paul Miller
Melbourne, Australia

Paul,

Sorry for too late response.

It's a DOORS component to use for exporting objects from DOORS. I searched it from google, but can not find few topic about it. There is a fix list for DOORS 9.2 talking about it. Link: https://www-304.ibm.com/support/docview.wss?uid=swg27017124&wv=1

My question is that when I export a picture object to xml file from DOORS by using DRML, the drml contents in the xml are not the same with what we see from DOORS. See below exported xml code:
 

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
 <module baseline="Current" doors_version="DOORS 9.3.0.0">
 <object has_inlinks="false" has_outlinks="false" modified="true">
  <attribute name="Object Text" /> 
  </object>
 <object has_inlinks="false" has_outlinks="false" modified="true">
 <attribute name="Object Text">
 <drml>
 <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> 
 This is a test picture 
 </drml>
 </attribute>
 </object>
 </module>

 


I also attached a screenshot from DOORS module.

We can see the different that the text part in the xml is after the picture. But actually, it should be before the picture, like what we see from DOORS module.
Thanks

Edward

 


Attachments

attachment_14632148_screenshot.JPG

Re: About DRML
Mathias Mamsch - Wed Jun 22 05:10:31 EDT 2011

Edward_Wang - Wed Jun 22 04:45:42 EDT 2011

Paul,

Sorry for too late response.

It's a DOORS component to use for exporting objects from DOORS. I searched it from google, but can not find few topic about it. There is a fix list for DOORS 9.2 talking about it. Link: https://www-304.ibm.com/support/docview.wss?uid=swg27017124&wv=1

My question is that when I export a picture object to xml file from DOORS by using DRML, the drml contents in the xml are not the same with what we see from DOORS. See below exported xml code:
 

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
 <module baseline="Current" doors_version="DOORS 9.3.0.0">
 <object has_inlinks="false" has_outlinks="false" modified="true">
  <attribute name="Object Text" /> 
  </object>
 <object has_inlinks="false" has_outlinks="false" modified="true">
 <attribute name="Object Text">
 <drml>
 <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> 
 This is a test picture 
 </drml>
 </attribute>
 </object>
 </module>

 


I also attached a screenshot from DOORS module.

We can see the different that the text part in the xml is after the picture. But actually, it should be before the picture, like what we see from DOORS module.
Thanks

Edward

 

So what do you want to know? Yes there are Perms in DOORS 9.x for exporting the contents of an Object in DRML. The Rational Publishing Engine uses this method for exporting DOORS data. It is not documented (so probably IBM considers this a IBM-only feature). I think it might stand for "DOORS Requirement Markup Language", so a proprietary XML format.
These are the perms that will probably spit out DRML infos.
 

string drmlText (Buffer&, Column, Object, string, bool)
string drmlText (Buffer&, Attr__, string, bool)
string drmlText (Buffer&, Column, Object, string)
string DRMLToRichText_ (Buffer&)
string DRML (Attr__)

 


Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: About DRML
Edward_Wang - Wed Jun 22 23:03:11 EDT 2011

Mathias Mamsch - Wed Jun 22 05:10:31 EDT 2011

So what do you want to know? Yes there are Perms in DOORS 9.x for exporting the contents of an Object in DRML. The Rational Publishing Engine uses this method for exporting DOORS data. It is not documented (so probably IBM considers this a IBM-only feature). I think it might stand for "DOORS Requirement Markup Language", so a proprietary XML format.
These are the perms that will probably spit out DRML infos.
 

string drmlText (Buffer&, Column, Object, string, bool)
string drmlText (Buffer&, Attr__, string, bool)
string drmlText (Buffer&, Column, Object, string)
string DRMLToRichText_ (Buffer&)
string DRML (Attr__)

 


Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Mathias,

Thanks for your reply. I found there is an issue when exporting DOORS picture to xml by DRML, but not sure whether it is a DOORS DRML issue or not. As we know, when we insert a picture in DOORS, there always will be a default text <Picture> bound in front of the picture. You can see the attached screen shot. We hope that the exported xml code format can keep identical with it. That means the text <Picture> should be in front of the picture in the xml code. But in fact, the text is after the picture. See below code, which is exported by DRML:
 

<attribute name="Object Text">
 <drml>
  <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> 
  <Picture> 
  </drml>
  </attribute>

 


It caused once we used above code to generate a report, the output doc format will be different with what we see from DOORS. (In the output doc, the text <Picture> will be followed the picture, but not in front of the picture.)

I expect that the exported xml code for DOORS picture by DRML can keep identical with what we see in DOORS, like below code:

 

 

 

<attribute name="Object Text">
 <drml>
  <Picture>
  <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> 
  </drml>
  </attribute>

 


Could you help me to figure out it? Is it a DRML issue?

Thank you
Edward

 

 

 

 

 

 


Attachments

attachment_14632517_screenshot.JPG

Re: About DRML
Mathias Mamsch - Thu Jun 23 06:53:41 EDT 2011

Edward_Wang - Wed Jun 22 23:03:11 EDT 2011

Mathias,

Thanks for your reply. I found there is an issue when exporting DOORS picture to xml by DRML, but not sure whether it is a DOORS DRML issue or not. As we know, when we insert a picture in DOORS, there always will be a default text <Picture> bound in front of the picture. You can see the attached screen shot. We hope that the exported xml code format can keep identical with it. That means the text <Picture> should be in front of the picture in the xml code. But in fact, the text is after the picture. See below code, which is exported by DRML:
 

<attribute name="Object Text">
 <drml>
  <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> 
  <Picture> 
  </drml>
  </attribute>

 


It caused once we used above code to generate a report, the output doc format will be different with what we see from DOORS. (In the output doc, the text <Picture> will be followed the picture, but not in front of the picture.)

I expect that the exported xml code for DOORS picture by DRML can keep identical with what we see in DOORS, like below code:

 

 

 

<attribute name="Object Text">
 <drml>
  <Picture>
  <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> 
  </drml>
  </attribute>

 


Could you help me to figure out it? Is it a DRML issue?

Thank you
Edward

 

 

 

 

 

 

Ok, I think that you should not use pictures at all... Remember they are saved uncompressed on the server, meaning with every baseline you do you will generate a lot of wasted space ;-) Maybe the fastest option would be to write a script that will replace the pictures by OLE objects ... That being said, yes I think that is an issue with the DRML engine. This needs to be resolved by either adapting the export or the internal DRML perms.

What exporter do you use? Rational Publishing Engine light I figure?

Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: About DRML
Edward_Wang - Thu Jun 23 22:54:59 EDT 2011

Mathias Mamsch - Thu Jun 23 06:53:41 EDT 2011
Ok, I think that you should not use pictures at all... Remember they are saved uncompressed on the server, meaning with every baseline you do you will generate a lot of wasted space ;-) Maybe the fastest option would be to write a script that will replace the pictures by OLE objects ... That being said, yes I think that is an issue with the DRML engine. This needs to be resolved by either adapting the export or the internal DRML perms.

What exporter do you use? Rational Publishing Engine light I figure?

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Mathias,

Yes, I am a developer of Rational Publishing Engine. Well, it's a DRML issue, what should I do next? Raise a DRML defect or contact with DOORS dev team first? Could you give some advice?
Thanks & Regards
Edward

Re: About DRML
Mathias Mamsch - Fri Jun 24 03:34:46 EDT 2011

Edward_Wang - Thu Jun 23 22:54:59 EDT 2011
Mathias,

Yes, I am a developer of Rational Publishing Engine. Well, it's a DRML issue, what should I do next? Raise a DRML defect or contact with DOORS dev team first? Could you give some advice?
Thanks & Regards
Edward

Sure you can raise a defect with DRML, but the question is, if that is really a defect since one could argue, that the position of the picture tag does not matter for the DRML. Information is still completely valid. The second problem will be, if a fix is going to be made, then it will only be incorporated in future DOORS releases, so it will not resolve any current problems.

Did I get this right, you are a developer of the Rational Publishing Engine?? If so, you should simply modify it, so it will export attached pictures before the text of the object. If not ... well, I guess you would need a pretty bad hack to correct the problem manually in the DRML, before RPE consumes it ;-)

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: About DRML
Mathias Mamsch - Fri Jun 24 03:44:43 EDT 2011

Mathias Mamsch - Fri Jun 24 03:34:46 EDT 2011
Sure you can raise a defect with DRML, but the question is, if that is really a defect since one could argue, that the position of the picture tag does not matter for the DRML. Information is still completely valid. The second problem will be, if a fix is going to be made, then it will only be incorporated in future DOORS releases, so it will not resolve any current problems.

Did I get this right, you are a developer of the Rational Publishing Engine?? If so, you should simply modify it, so it will export attached pictures before the text of the object. If not ... well, I guess you would need a pretty bad hack to correct the problem manually in the DRML, before RPE consumes it ;-)

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Regarding bad hacks: For example, if the Rational Publishing Engine uses a function, you could hook it. Imagine the Publishing engine would import a file called RPE.inc where the encrypted DXL source is located and that will call the following function to grab information from DOORS.

string drmlText (Buffer&, Column, Object, string, bool)

 


You could rename that file to RPE_hooked.inc and create a new RPE.inc:

 

 

 

string drmlTextOld (Buffer& b, Column c, Object o, string s, bool bl) { return drmlText (b,c,o,s,bl) }
 
string drmlText (Buffer& b, Column c, Object o, string s, bool bl) { 
   string return = drmlTextOld (b,c,o,s,bl) 
   // ... postprocess the DRML here ...
   return return 
}
 
#include <RPE_hooked.inc>



Then you successfully altered the bevaviour if the drmlText function without the need of modifying RPE or DOORS. But really: I think anyone should be advised not to use pictures, and when they really want to use pictures, then put the text in a separate object.



 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: About DRML
Mathias Mamsch - Fri Jun 24 03:46:20 EDT 2011

Mathias Mamsch - Fri Jun 24 03:44:43 EDT 2011

Regarding bad hacks: For example, if the Rational Publishing Engine uses a function, you could hook it. Imagine the Publishing engine would import a file called RPE.inc where the encrypted DXL source is located and that will call the following function to grab information from DOORS.

string drmlText (Buffer&, Column, Object, string, bool)

 


You could rename that file to RPE_hooked.inc and create a new RPE.inc:

 

 

 

string drmlTextOld (Buffer& b, Column c, Object o, string s, bool bl) { return drmlText (b,c,o,s,bl) }
 
string drmlText (Buffer& b, Column c, Object o, string s, bool bl) { 
   string return = drmlTextOld (b,c,o,s,bl) 
   // ... postprocess the DRML here ...
   return return 
}
 
#include <RPE_hooked.inc>



Then you successfully altered the bevaviour if the drmlText function without the need of modifying RPE or DOORS. But really: I think anyone should be advised not to use pictures, and when they really want to use pictures, then put the text in a separate object.



 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

yeah, 'return' in my previous post is probably not a good variable name ... just replace it by rReturn ;-)

Re: About DRML
Edward_Wang - Sun Jun 26 23:34:03 EDT 2011

Mathias Mamsch - Fri Jun 24 03:44:43 EDT 2011

Regarding bad hacks: For example, if the Rational Publishing Engine uses a function, you could hook it. Imagine the Publishing engine would import a file called RPE.inc where the encrypted DXL source is located and that will call the following function to grab information from DOORS.

string drmlText (Buffer&, Column, Object, string, bool)

 


You could rename that file to RPE_hooked.inc and create a new RPE.inc:

 

 

 

string drmlTextOld (Buffer& b, Column c, Object o, string s, bool bl) { return drmlText (b,c,o,s,bl) }
 
string drmlText (Buffer& b, Column c, Object o, string s, bool bl) { 
   string return = drmlTextOld (b,c,o,s,bl) 
   // ... postprocess the DRML here ...
   return return 
}
 
#include <RPE_hooked.inc>



Then you successfully altered the bevaviour if the drmlText function without the need of modifying RPE or DOORS. But really: I think anyone should be advised not to use pictures, and when they really want to use pictures, then put the text in a separate object.



 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Mathias,

Thank you very much!

As I am not an experience DXL or DRML developer, and just pick up them for a short while. It's a little difficult for me to totally understand what you said. But I appreciate what you have done. Actually, there are many functions will call drmlText in RPE.inc. I didn't figure out which place I should modify. Maybe you can provide more information about below question to help me address it:

1. Could you give me a detail introduction about these perm definition? What's the purpose and when should I use them?

string drmlText (Buffer&, Column, Object, string, bool)
string drmlText (Buffer&, Attr__, string, bool)
string drmlText (Buffer&, Column, Object, string)
string DRMLToRichText_ (Buffer&)
string DRML (Attr__)

 


2. My goal is to modify the sequence of the picture and the text for Picture Object in DOORS. If I do this modification, is there any influence for getting other object?

3. You said if clients really want to use pictures, they should better put the text in a separate object. But the default picture object always bound a default text '<Picture>'. Could it be removed or will not be shown?

Thanks

Edward

 

Re: About DRML
Mathias Mamsch - Mon Jun 27 07:49:29 EDT 2011

Edward_Wang - Sun Jun 26 23:34:03 EDT 2011

Mathias,

Thank you very much!

As I am not an experience DXL or DRML developer, and just pick up them for a short while. It's a little difficult for me to totally understand what you said. But I appreciate what you have done. Actually, there are many functions will call drmlText in RPE.inc. I didn't figure out which place I should modify. Maybe you can provide more information about below question to help me address it:

1. Could you give me a detail introduction about these perm definition? What's the purpose and when should I use them?

string drmlText (Buffer&, Column, Object, string, bool)
string drmlText (Buffer&, Attr__, string, bool)
string drmlText (Buffer&, Column, Object, string)
string DRMLToRichText_ (Buffer&)
string DRML (Attr__)

 


2. My goal is to modify the sequence of the picture and the text for Picture Object in DOORS. If I do this modification, is there any influence for getting other object?

3. You said if clients really want to use pictures, they should better put the text in a separate object. But the default picture object always bound a default text '<Picture>'. Could it be removed or will not be shown?

Thanks

Edward

 

I think you should just adapt the specific renderer to output the pictures at the end of the object. However there might be a problem that you cannot differentiate between pictures and OLEs so in this case you would need to rely on DOORS and DXL where the information, if the object has a picture is still there.

Regarding your questions:
1. Sorry I cannot tell you the exact details for the perms. As I said, IBM seems to consider them "IBM only" and did not document them properly, so I could only guess or find out by trial and error, but I think they are pretty self explanatory:
 

string drmlText (Buffer &buf, Column col, Object obj, string dir, bool useSymbols)
string drmlText (Buffer &buf, Attr__ ad, string dir, bool useSymbols)

 

 

  • buf is the buffer that will receive the DRML
  • If you export Layout DXL then obj is the object and col the column to export
  • If you export an attribute then ad is the attribute to export
  • The dir parameter seems to be the working directory where to place the files
  • I am not sure about the useSymbols but I guess it has to do with escaping special characters


You dont need to use the other perms I figure. As far as I know RPE it will encapsule the DRML functions in only one function called rpe_drmlText() which has the same parameters as the perm above. So you could make a modification of this perm (see below).

2. Modifying the sequence of the attachment could be done from DXL with a code like this:

 

 

 

Buffer buf = create(); buf = "<attribute name=\"Object Text\">
- <drml>
  <attachment ref=\"OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png\" type=\"image/png\" sv=\"0\" width=\"1920\" height=\"1200\" /> 
  <Picture> 
  </drml>
  </attribute>"
 
print "Before:\n\n" (tempStringOf buf) "\n"
 
// depending on the DOORS version you may want to use regexp2
Regexp reAttachment = regexp "[\n\r ]+<attachment ref=[^>]+/>"
Regexp reDRML = regexp "[\n\r ]+</drml>"
 
 
int indexStartAttachment = 0, indexEndAttachment = 0, indexDRML = 0
int dummy
 
if (search (reAttachment, buf,0) ) { // we have an attachment in here ...
  indexEndAttachment   = end   0 
  indexStartAttachment = start 0
  if (search (reDRML, buf, 0)) { 
      indexDRML = start 0   // insert before the DRML closing tag
      print "\n\nMoving Range " indexStartAttachment ":" indexEndAttachment " to " indexDRML "\n\n"
      Buffer bufNew = create() 
      // first add everything before the attachment 
      combine(bufNew, buf, 0, indexStartAttachment-1) 
      // then add everything after the attachment till the DRML 
      combine(bufNew, buf, indexEndAttachment+1, indexDRML-1) 
      // then add the attachment 
      combine(bufNew, buf, indexStartAttachment, indexEndAttachment) 
      // then add the rest 
    combine(bufNew, buf, indexDRML)
 
      // modifying the rpe_drmlText function is left as an exercise for the reader ... 
      print bufNew "" 
  } else {
     print "Invalid DRML"
  }
}




But I guess you would need to take care with OLE objects. I have never really used RPE, but it seems to me that it does not differentiate between OLE objects and pictures, giving the reference names start with OLE_ ... This would mean that the code would need to check first if it is really an object with a picture that you are exporting.

3. The <Picture> tag in the DOORS objects is really a relic from old DOORS versions, I can see only annoyance from that. My customers that still use picture tend to use a single space as the object text to suppress the <Picture> tag, but any export software should just ignore that text.

Hope that helps, regards, Mathias



 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: About DRML
Edward_Wang - Fri Jul 01 02:05:13 EDT 2011

Mathias Mamsch - Fri Jun 24 03:44:43 EDT 2011

Regarding bad hacks: For example, if the Rational Publishing Engine uses a function, you could hook it. Imagine the Publishing engine would import a file called RPE.inc where the encrypted DXL source is located and that will call the following function to grab information from DOORS.

string drmlText (Buffer&, Column, Object, string, bool)

 


You could rename that file to RPE_hooked.inc and create a new RPE.inc:

 

 

 

string drmlTextOld (Buffer& b, Column c, Object o, string s, bool bl) { return drmlText (b,c,o,s,bl) }
 
string drmlText (Buffer& b, Column c, Object o, string s, bool bl) { 
   string return = drmlTextOld (b,c,o,s,bl) 
   // ... postprocess the DRML here ...
   return return 
}
 
#include <RPE_hooked.inc>



Then you successfully altered the bevaviour if the drmlText function without the need of modifying RPE or DOORS. But really: I think anyone should be advised not to use pictures, and when they really want to use pictures, then put the text in a separate object.



 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Mathias,

These days, I'm focus on another thing. I'm sorry for giving your my update so late. Thanks for your effort on it. I think this sample code is more helpful for me. But I also have confusion in understanding it and how to implement in my code.
I give you my sample code structure for exporting DOORS picture to xml, could you help re-strcutre it against your sample? There are two inc files. The doors2xml.inc will call the drmlText() function from doorsperm.inc.

In doors2xml.inc, the code:
 

//call rpe_drmlText() function from doorsperms.inc
rpe_drmlText(b,obj.parseString, strWorkDir, true, nonUnicodeFonts)
 
if(stringOf(b)!="<drml></drml>")
    {
                //write the drml result to xml
                writeString(stringOf(b), false)
        }


In doorsperms.inc, it will call the DOORS drml function:

 

 

string rpe_drmlText(Buffer& b, Attr__ attr, string dir, bool useSymbols, string nonUnicodeFonts)
{
    //call DOORS drmlText() function
        return drmlText(b, attr, dir, useSymbols)
}

 

 

Re: About DRML
Mathias Mamsch - Fri Jul 01 05:00:02 EDT 2011

Edward_Wang - Fri Jul 01 02:05:13 EDT 2011

Mathias,

These days, I'm focus on another thing. I'm sorry for giving your my update so late. Thanks for your effort on it. I think this sample code is more helpful for me. But I also have confusion in understanding it and how to implement in my code.
I give you my sample code structure for exporting DOORS picture to xml, could you help re-strcutre it against your sample? There are two inc files. The doors2xml.inc will call the drmlText() function from doorsperm.inc.

In doors2xml.inc, the code:
 

//call rpe_drmlText() function from doorsperms.inc
rpe_drmlText(b,obj.parseString, strWorkDir, true, nonUnicodeFonts)
 
if(stringOf(b)!="<drml></drml>")
    {
                //write the drml result to xml
                writeString(stringOf(b), false)
        }


In doorsperms.inc, it will call the DOORS drml function:

 

 

string rpe_drmlText(Buffer& b, Attr__ attr, string dir, bool useSymbols, string nonUnicodeFonts)
{
    //call DOORS drmlText() function
        return drmlText(b, attr, dir, useSymbols)
}

 

 

Heh. So finally I work for IBM ... Will you add a 'This product contains technology from Mathias Mamsch (IT-QBase) GmbH' somewhere in the 'Thank you to' part of the help file? ;-) Kidding ...

The general idea (without trying) would be:
 

// depending on the DOORS version you may want to use regexp2
Regexp reAttachment = regexp "[\n\r ]+<attachment ref=[^>]+/>"
Regexp reDRML = regexp "[\n\r ]+</drml>"
 
void move_attachment (Buffer buf) {
    int indexStartAttachment = 0, indexEndAttachment = 0, indexDRML = 0
    int dummy
     
    if (search (reAttachment, buf,0) ) { // we have an attachment in here ...
      indexEndAttachment   = end   0 
      indexStartAttachment = start 0
      if (search (reDRML, buf, 0)) { 
          indexDRML = start 0   // insert before the DRML closing tag
          // print "\n\nMoving Range " indexStartAttachment ":" indexEndAttachment " to " indexDRML "\n\n"
          Buffer bufNew = create() 
          // first add everything before the attachment 
          combine(bufNew, buf, 0, indexStartAttachment-1) 
          // then add everything after the attachment till the DRML 
          combine(bufNew, buf, indexEndAttachment+1, indexDRML-1) 
          // then add the attachment 
          combine(bufNew, buf, indexStartAttachment, indexEndAttachment) 
          // then add the rest 
          combine(bufNew, buf, indexDRML)
     
          // modifying the rpe_drmlText function is left as an exercise for the reader ... 
          setempty buf
          combine(buf, bufNew,0) 
          delete bufNew
          
      } else {
          print "Warning: Invalid DRML:" (stringOf buf) "\n" 
      }
    }
}
 
string rpe_drmlText(Buffer& b, Attr__ attr, string dir, bool useSymbols, string nonUnicodeFonts)
{
    //call DOORS drmlText() function, save return value
    string ret = drmlText(b, attr, dir, useSymbols)
    move_attachment b
    return ret
}

 


Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: About DRML
Edward_Wang - Fri Jul 01 06:12:21 EDT 2011

Mathias Mamsch - Fri Jul 01 05:00:02 EDT 2011

Heh. So finally I work for IBM ... Will you add a 'This product contains technology from Mathias Mamsch (IT-QBase) GmbH' somewhere in the 'Thank you to' part of the help file? ;-) Kidding ...

The general idea (without trying) would be:
 

// depending on the DOORS version you may want to use regexp2
Regexp reAttachment = regexp "[\n\r ]+<attachment ref=[^>]+/>"
Regexp reDRML = regexp "[\n\r ]+</drml>"
 
void move_attachment (Buffer buf) {
    int indexStartAttachment = 0, indexEndAttachment = 0, indexDRML = 0
    int dummy
     
    if (search (reAttachment, buf,0) ) { // we have an attachment in here ...
      indexEndAttachment   = end   0 
      indexStartAttachment = start 0
      if (search (reDRML, buf, 0)) { 
          indexDRML = start 0   // insert before the DRML closing tag
          // print "\n\nMoving Range " indexStartAttachment ":" indexEndAttachment " to " indexDRML "\n\n"
          Buffer bufNew = create() 
          // first add everything before the attachment 
          combine(bufNew, buf, 0, indexStartAttachment-1) 
          // then add everything after the attachment till the DRML 
          combine(bufNew, buf, indexEndAttachment+1, indexDRML-1) 
          // then add the attachment 
          combine(bufNew, buf, indexStartAttachment, indexEndAttachment) 
          // then add the rest 
          combine(bufNew, buf, indexDRML)
     
          // modifying the rpe_drmlText function is left as an exercise for the reader ... 
          setempty buf
          combine(buf, bufNew,0) 
          delete bufNew
          
      } else {
          print "Warning: Invalid DRML:" (stringOf buf) "\n" 
      }
    }
}
 
string rpe_drmlText(Buffer& b, Attr__ attr, string dir, bool useSymbols, string nonUnicodeFonts)
{
    //call DOORS drmlText() function, save return value
    string ret = drmlText(b, attr, dir, useSymbols)
    move_attachment b
    return ret
}

 


Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Mathias,

Thank you very much!!

I tried to search your name in notes to send you a mail. Unfortunately, there are many people the same name with you. I'm not sure which one is the right person. Could you tell me your mailbox? We can discuss further by email. And a thanks letter is indeed necessary, because you really help me much.

Edward